/* 公共数据 */
const CommonData: Common.StringMap<any> = {
  BaseURL: {
    // development: 'http://172.16.0.20:5000',
    development: 'http://45.40.244.50:5000',
    // development: 'http://172.16.0.20:8005',
    test: `http://${document.domain}:81/auth/authurl`,
    production: `http://${document.domain}/auth/authurl`,
  },
  AuthPlatformURL: {
    development: 'http://localhost:8000',
    test: `http://${document.domain}:81/auth`,
    production: `http://${document.domain}/auth`,
  },
  QRCodeURL: {
    development: 'http://localhost:8001',
    test: `http://${document.domain}:81/qrcode`,
    production: `http://${document.domain}/qrcode`,
  },
  LoginURL: {
    development: 'http://localhost:8000/#/login',
    test: `http://${document.domain}:81/auth/login`,
    production: `http://${document.domain}/auth/login`,
  },
  BaseWebSocket: {
    // development: 'http://172.16.0.20:5000',
    development: 'http://45.40.244.50:5000',
    // development: 'http://172.16.0.20:8005',
    test: `http://${document.domain}:81/auth/authwebsocket`,
    production: `http://${document.domain}/auth/authwebsocket`,
  },
}

/* 侧边栏菜单数据 */
const menus = (UserAuth?: any) => {
  return [
    { key: '/home', icon: 'home', link: '/home', title: '主页', show: true },
    { key: '/home/users', icon: 'user', link: '/home/users', title: '用户管理', show: UserAuth.indexOf('Sys.User') !== -1 },
    { key: '/home/roles', icon: 'team', link: '/home/roles', title: '角色管理', show: UserAuth.indexOf('Sys.Role') !== -1 },
    { key: '/home/authObjects', icon: 'team', link: '/home/authObjects', title: '权限管理', show: UserAuth.indexOf('Sys.AuthObject') !== -1  },
    { key: '/home/company', icon: 'appstore', link: '/home/company', title: '公司管理', show: UserAuth.indexOf('Sys.Company') !== -1  },
  ]
}

export {
  CommonData,
  menus
}